﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using PizzaService.Controller;
using System.Windows.Markup;
using System.Globalization;

namespace PizzaService
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private static PizzaController m_Controller;

        

        public App()
        {
            initController();
        }

        public static PizzaController Controller
        {
            get
            {
                if (m_Controller == null)
                    m_Controller = new PizzaController();

                return m_Controller;
            }
            set { m_Controller = value; }
        }

        private void initController()
        {
            m_Controller = new PizzaController();
        }

        protected override void OnStartup(StartupEventArgs e) 
        { 
            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); 
            base.OnStartup(e); 
        } 
    }
}
